package com.amoos.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.amoos.service.HelloService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/hello")
public class HelloController {
    @Reference/*会订阅zookeeper，会到zookeeper注册中心查找 helloService服务*/
    private HelloService helloService;

    @RequestMapping("sayHello")
    @ResponseBody
    public String sayHello(String name){
        return helloService.sayHello(name);

    }
}
